package com.yanqu.road.entity.activity.youxing;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.property.Property;

import java.util.List;
import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_xing_you_user_data", desc = "行游山水玩家数据")
public class CrossXingYouShanShuiUserData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
    private int activityId;

    @FieldTypeAnnotation(update = true, desc = "分组id")
    private int groupId;

    @FieldTypeAnnotation(update = true, desc = "玩家ID")
    private long userId;

    @FieldTypeAnnotation(desc = "体力")
    private int energy ;

    @FieldTypeAnnotation(desc = "总消耗体力")
    private int useEnergy;

    @FieldTypeAnnotation(desc = "队伍id")
    private int teamId;

    @FieldTypeAnnotation(desc = "上次使用体力的时间")
    private long energyLastTime ;

    @FieldTypeAnnotation(desc = "活动角色id")
    private int roleId;

    @FieldTypeAnnotation(desc = "队长购买的角色")
    private List<Integer> buyRole;

    @FieldTypeAnnotation(desc = "所在棋盘的队伍")
    private int mapTeamId;

    @FieldTypeAnnotation(desc = "格子状态")
    private ShanShuiGridParam gridParam;

    @FieldTypeAnnotation(desc = "漂泊状态，格子状态")
    private ShanShuiGridParam driftGridParam;

    @FieldTypeAnnotation(desc = "美女")
    private List<ShanShuiBeauty> beautyList;

    @FieldTypeAnnotation(desc = "能力更新时间")
    private long lastAbilityUpdateTime;

    @FieldTypeAnnotation(desc = "协战次数")
    private int helpTimes;

    @FieldTypeAnnotation(desc = "队伍创建次数")
    private int createTeamTimes;

    @FieldTypeAnnotation(desc = "银票")
    private long silverCoin;

    @FieldTypeAnnotation(desc = "累计获得银票")
    private long silverCoinTotal;

    @FieldTypeAnnotation(desc = "累计获得银票-更新时间")
    private long silverUpdateTime;

    @FieldTypeAnnotation(desc = "健步如飞次数")
    private int flyTimes;

    @FieldTypeAnnotation(desc = "漂泊骰子次数")
    private int driftTimes;

    @FieldTypeAnnotation(desc = "漂泊结束原因： -5 超时, -4 到玉门关,-3 骰子用完，-2 被抓")
    private int driftEndType;

    @FieldTypeAnnotation(desc = "漂泊的奖励")
    private Property driftReward;

    @FieldTypeAnnotation(desc = "漂泊的开始时间")
    private long startDriftTime;

    @FieldTypeAnnotation(desc = "祈愿获得的金页子(改成只展示，操作时实时获得)")
    private int wishShareValue;

    @FieldTypeAnnotation(desc = "捕快抓捕的奖励(只是展示用)")
    private Property captorReward;

    @FieldTypeAnnotation(desc = "祈愿获得的金页子-最后领取时间")
    private long wishShareLastGetTime;

    @FieldTypeAnnotation(desc = "语言")
    private String language = "";

    @FieldTypeAnnotation(desc = "圈数")
    private int round;

    @FieldTypeAnnotation(desc = "吉星高照次数")
    private int luckyTimes;

    @FieldTypeAnnotation(desc = "霉运缠身次数")
    private int misfortuneTimes;

    @FieldTypeAnnotation(desc = "未跳过的格子")
    private List<Integer> notTouchGrid;

    @FieldTypeAnnotation(desc = "妈祖庙-宣言")
    private String declaration = "";

    @FieldTypeAnnotation(desc = "妈祖庙-宣言设置CD")
    private long declareCd;

    //cache
    private int testEventId;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if(this.groupId != groupId) {
            this.groupId = groupId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if(this.energy != energy) {
            this.energy = energy;
            setUpdateOption();
        }
    }

    public int getUseEnergy() {
        return useEnergy;
    }

    public void setUseEnergy(int useEnergy) {
        if(this.useEnergy != useEnergy) {
            this.useEnergy = useEnergy;
            setUpdateOption();
        }
    }

    public int getTeamId() {
        return teamId;
    }

    public void setTeamId(int teamId) {
        if(this.teamId != teamId) {
            this.teamId = teamId;
            setUpdateOption();
        }
    }

    public long getEnergyLastTime() {
        return energyLastTime;
    }

    public void setEnergyLastTime(long energyLastTime) {
        if(this.energyLastTime != energyLastTime) {
            this.energyLastTime = energyLastTime;
            setUpdateOption();
        }
    }

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        if(this.roleId != roleId) {
            this.roleId = roleId;
            setUpdateOption();
        }
    }

    public List<Integer> getBuyRole() {
        return buyRole;
    }

    public void setBuyRole(List<Integer> buyRole) {
        this.buyRole = buyRole;
        setUpdateOption();
    }

    public int getMapTeamId() {
        return mapTeamId;
    }

    public void setMapTeamId(int mapTeamId) {
        if(this.mapTeamId != mapTeamId) {
            this.mapTeamId = mapTeamId;
            setUpdateOption();
        }
    }

    public ShanShuiGridParam getGridParam() {
        return gridParam;
    }

    public void setGridParam(ShanShuiGridParam gridParam) {
        this.gridParam = gridParam;
        setUpdateOption();
    }

    public ShanShuiGridParam getDriftGridParam() {
        return driftGridParam;
    }

    public void setDriftGridParam(ShanShuiGridParam driftGridParam) {
        this.driftGridParam = driftGridParam;
        setUpdateOption();
    }

    public List<ShanShuiBeauty> getBeautyList() {
        return beautyList;
    }

    public void setBeautyList(List<ShanShuiBeauty> beautyList) {
        this.beautyList = beautyList;
        setUpdateOption();
    }

    public long getLastAbilityUpdateTime() {
        return lastAbilityUpdateTime;
    }

    public void setLastAbilityUpdateTime(long lastAbilityUpdateTime) {
        if(this.lastAbilityUpdateTime != lastAbilityUpdateTime) {
            this.lastAbilityUpdateTime = lastAbilityUpdateTime;
            setUpdateOption();
        }
    }

    public int getHelpTimes() {
        return helpTimes;
    }

    public void setHelpTimes(int helpTimes) {
        if(this.helpTimes != helpTimes) {
            this.helpTimes = helpTimes;
            setUpdateOption();
        }
    }

    public int getCreateTeamTimes() {
        return createTeamTimes;
    }

    public void setCreateTeamTimes(int createTeamTimes) {
        if(this.createTeamTimes != createTeamTimes) {
            this.createTeamTimes = createTeamTimes;
            setUpdateOption();
        }
    }

    public long getSilverCoin() {
        return silverCoin;
    }

    public void setSilverCoin(long silverCoin) {
        if(this.silverCoin != silverCoin) {
            this.silverCoin = silverCoin;
            setUpdateOption();
        }
    }

    public long getSilverCoinTotal() {
        return silverCoinTotal;
    }

    public void setSilverCoinTotal(long silverCoinTotal) {
        if(this.silverCoinTotal != silverCoinTotal) {
            this.silverCoinTotal = silverCoinTotal;
            setUpdateOption();
        }
    }


    public long getSilverUpdateTime() {
        return silverUpdateTime;
    }

    public void setSilverUpdateTime(long silverUpdateTime) {
        if(this.silverUpdateTime != silverUpdateTime) {
            this.silverUpdateTime = silverUpdateTime;
            setUpdateOption();
        }
    }

    public int getDriftTimes() {
        return driftTimes;
    }

    public void setDriftTimes(int driftTimes) {
        if(this.driftTimes != driftTimes) {
            this.driftTimes = driftTimes;
            setUpdateOption();
        }
    }

    public int getFlyTimes() {
        return flyTimes;
    }

    public void setFlyTimes(int flyTimes) {
        if(this.flyTimes != flyTimes) {
            this.flyTimes = flyTimes;
            setUpdateOption();
        }
    }

    public Property getDriftReward() {
        return driftReward;
    }

    public void setDriftReward(Property driftReward) {
        this.driftReward = driftReward;
        setUpdateOption();
    }

    public int getDriftEndType() {
        return driftEndType;
    }

    public void setDriftEndType(int driftEndType) {
        if(this.driftEndType != driftEndType) {
            this.driftEndType = driftEndType;
            setUpdateOption();
        }
    }

    public long getStartDriftTime() {
        return startDriftTime;
    }

    public void setStartDriftTime(long startDriftTime) {
        if(this.startDriftTime != startDriftTime) {
            this.startDriftTime = startDriftTime;
            setUpdateOption();
        }
    }

    public int getWishShareValue() {
        return wishShareValue;
    }

    public void setWishShareValue(int wishShareValue) {
        if(this.wishShareValue != wishShareValue) {
            this.wishShareValue = wishShareValue;
            setUpdateOption();
        }
    }

    public Property getCaptorReward() {
        return captorReward;
    }

    public void setCaptorReward(Property captorReward) {
        this.captorReward = captorReward;
        setUpdateOption();
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        if(Objects.equals(this.language, language)){
            this.language = language;
            setUpdateOption();
        }
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if(this.round != round) {
            this.round = round;
            setUpdateOption();
        }
    }

    public long getWishShareLastGetTime() {
        return wishShareLastGetTime;
    }

    public void setWishShareLastGetTime(long wishShareLastGetTime) {
        if(this.wishShareLastGetTime != wishShareLastGetTime) {
            this.wishShareLastGetTime = wishShareLastGetTime;
            setUpdateOption();
        }
    }

    public int getLuckyTimes() {
        return luckyTimes;
    }

    public void setLuckyTimes(int luckyTimes) {
        if(this.luckyTimes != luckyTimes) {
            this.luckyTimes = luckyTimes;
            setUpdateOption();
        }
    }

    public int getMisfortuneTimes() {
        return misfortuneTimes;
    }

    public void setMisfortuneTimes(int misfortuneTimes) {
        if(this.misfortuneTimes != misfortuneTimes) {
            this.misfortuneTimes = misfortuneTimes;
            setUpdateOption();
        }
    }

    public List<Integer> getNotTouchGrid() {
        return notTouchGrid;
    }

    public void setNotTouchGrid(List<Integer> notTouchGrid) {
        this.notTouchGrid = notTouchGrid;
        setUpdateOption();
    }

    public String getDeclaration() {
        return declaration;
    }

    public void setDeclaration(String declaration) {
        if(!Objects.equals(this.declaration, declaration)) {
            this.declaration = declaration;
            setUpdateOption();
        }
    }

    public long getDeclareCd() {
        return declareCd;
    }

    public void setDeclareCd(long declareCd) {
        this.declareCd = declareCd;
    }

    /**
     * 是否是漂泊状态
     * @return
     */
    public boolean isDrift(){
        return mapTeamId > 0 && mapTeamId != teamId;
    }

    public int getTestEventId() {
        return testEventId;
    }

    public void setTestEventId(int testEventId) {
        this.testEventId = testEventId;
    }
}
